<template>
	<view id="app">
		<iframe style="border:none" :width="searchTableWidth" :height="searchTableHeight"
			v-bind:src="reportUrl"></iframe>
	</view>
</template>
<script>
	import Vue from 'vue'
	export default {
		methods: {
			widthHeight() {
				this.searchTableHeight = window.innerHeight
				this.searchTableWidth = window.innerWidth
			},
		},
		data() {
			return {
				reportUrl: 'http://typhoon.zjwater.gov.cn/wap.htm?from=singlemessage&isappinstalled=0',
				searchTableHeight: 0,
				searchTableWidth: 0
			}
		},
		onLoad(options) {
			// uni.setNavigationBarTitle({
			// 	title: "台风路径"
			// });
			// uni.setNavigationBarColor({
			// 	frontColor: "#ffffff", //文字颜色
			// 	backgroundColor: "#1296db" //底部背景色
			// })
		},
		mounted() {
			window.onresize = () => {
				this.widthHeight(); // 自适应高宽度
			};
			this.$nextTick(function() {
				this.widthHeight();
			});
		},
		created() {
			// 从路由里动态获取 url地址   具体地址看libs下util.js里的 backendMenuToRoute  方法 
			this.reportUrl = 'http://typhoon.zjwater.gov.cn/wap.htm?from=singlemessage&isappinstalled=0'
		},
		watch: {
			'$route': function() {
				// 监听路由变化
				this.reportUrl = 'http://typhoon.zjwater.gov.cn/wap.htm?from=singlemessage&isappinstalled=0'
			}
		}
	}
</script>

<style>
</style>
